#include<iostream>
#include<string>
using namespace std;
typedef long long LL;
string s;
int n;
int main()
{
	cin >> n;
	getline(cin, s);
	getline(cin, s);
	LL a = 0, b = 0, c = 0;
	for (int i = 0; i < s.size(); i++) {
		if (s[i] == 'o') {
			a++;
		}
		else if (s[i] == 's') {
			b += a;
		}
		else if (s[i] == 'u') {
			c += b;
		}
	}
	cout << c << endl;
	return 0;
}